package example56789;

class Animal6{
    private String name;
    private int age;
    public Animal6(String name,int age){
        this.age=age;
        this.name=name;
    }
    public String getName(){
        return name;
    }
    public void  setName(String name){
        this.name = name;
    }
    public int getAge(){
        return age;
    }
    public void setAge(int age){
        this.age= age;
    }
    public String info(){
       return "名称:"+this.getName()+",年龄："+this.getAge();
    }
}
class Dog6 extends Animal6{
    private String color;
    public Dog6(String name,int age,String color){
        super(name, age);
        this.color =color;
    }
    public String getColor(){
        return color;
    }
    public void setColor(String color){
        this.color =color;
    }
    public String info(){
        return super.info()+"颜色:"+this.getColor();
    }
}
public class c6 {
    public static void main(String[] args) {
        Dog6 dog = new Dog6("牧羊犬",3,"黑色");

        System.out.println(dog.info());
    }
}
